package com.tomhw;

public class zinnia {

    //加载so文件
    static{
        try {
            System.loadLibrary("zinnia");
        } catch (Throwable e) {
            e.printStackTrace();
        }
    }

    //jni封装方法的声明
    //charater
    public native long characterNew();
    public native void characterDestroy(long c);
    public native void characterClear(long stroke);
    public native int characterAdd(long character, long id, int x, int y);
    public native void characterSetWidth(long character, long width);
    public native void characterSetHeight(long character, long height);

    public native long characterStrokesSize(long character);

    //recognizer
    public native long recognizerNew();
    public native void recognizerDestroy(long recognizer);
    public native int recognizerOpen(long recognizer, String filename);
    public native String recognizerStrerror(long recognizer);
    public native long recognizerClassify(long recognizer, long character, long nbest);

    //result
    public native String resultValue(long result, long index);
    public native float resultScore(long result, long index);
    public native long resultSize(long result);
    public native void resultDestroy(long result);
}
